package com.gimi.test_jpa.com.gimi.entity.customer;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * create table cus_base
 * (
 *    cus_id               varchar(36) not null comment '客户主键ID',
 *    用户简码                 varchar(30) comment '用户简码',
 *    姓名                   varchar(20) default NULL comment '姓名',
 *    性别                   int(2) default NULL comment '性别',
 *    cus_id_card          varchar(20) default NULL comment '身份证号码',
 *    cus_id_card_address  varchar(255) default NULL comment '证件地址',
 *    cus_national_org     varchar(100) default NULL comment '发证机关',
 *    cus_marital_status   int(2) default NULL comment '是否已婚',
 *    cus_education        varchar(100) default NULL comment '学历',
 *    cus_school           varchar(50) default NULL comment '毕业院校',
 *    cus_household        int(10) default NULL comment '户口性质 ',
 *    cus_adress           varchar(255) default NULL comment '户籍地址',
 *    source_id            varchar(50) comment '用户来源',
 *    register_version     varchar(50) comment '注册版本',
 *    add_name             varchar(50) default NULL comment '添加人名称',
 *    add_time             datetime comment '添加时间',
 *    product_id           varchar(36) not null comment '产品ID',
 *    product_no           varchar(20) default NULL comment '产品编号',
 *    product_name         varchar(50) default NULL comment '产品名称',
 *    primary key (cus_id),
 */
@Data
@Entity
@Table(name = "cus_base")
public class CustomerEntity {
    @Id
    @GenericGenerator(name = "systemUUID", strategy = "uuid")
    @GeneratedValue(generator = "systemUUID")
    @Column(name = "cus_id", columnDefinition = " varchar(36) NOT NULL comment 'id'")
    private String cusId;

    @Column(name = "cus_short_code",columnDefinition = "varchar(30) comment '用户简码'")
    private String cus_short_code;

    @Column(name = "cus_name",columnDefinition = "varchar(20) default NULL comment '姓名'")
    private String cusName;

    @Column(name = "cus_sex",columnDefinition = "int(2) default NULL comment '性别'")
    private Integer cusSex;

    @Column(name = "cus_id_card",columnDefinition = "varchar(20) default NULL comment '身份证号码'")
    private String cusIdCard;

    @Column(name = "cus_id_card_address",columnDefinition = "varchar(255) default NULL comment '证件地址'")
    private String cusIdCardAddress;

    @Column(name = "cus_national_org",columnDefinition = "varchar(100) default NULL comment '发证机关'")
    private String cusNatinalOrg;

    @Column(name = "cus_marital_status",columnDefinition = "int(2) default NULL comment '是否已婚'")
    private Integer cusMaritalStatus;

    @Column(name = "cus_education",columnDefinition = "varchar(100) default NULL comment '学历'")
    private String cusEducation;

    @Column(name = "cus_school",columnDefinition = "varchar(50) default NULL comment '毕业院校'")
    private String cusSchool;

    @Column(name = "cus_household",columnDefinition = "int(10) default NULL comment '户口性质 '")
    private Integer cusHousehold;

    @Column(name = "cus_address",columnDefinition = "varchar(255) default NULL comment '户籍地址'")
    private String cusAddrss;

    @Column(name = "source_id ",columnDefinition = "varchar(50) comment '用户来源'")
    private String sourceId;

    @Column(name = "register_version",columnDefinition = "varchar(50) comment '注册版本'")
    private String registerVersion;

    @Column(name = "add_name",columnDefinition = "varchar(50) default NULL comment '添加人名称'")
    private String addName;

    @Column(name = "add_time ",columnDefinition = "datetime comment '添加时间'")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss.sss")
    private Date addTime;

    @Column(name = " product_id ",columnDefinition = "varchar(36) not null comment '产品ID'")
    private String productId;

    @Column(name = "product_no",columnDefinition = "varchar(20) default NULL comment '产品编号'")
    private String productNo;

    @Column(name = "product_name",columnDefinition = "varchar(50) default NULL comment '产品名称'")
    private String productName;

}
